package cn.tedu.tourism.passenger.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class PassengerParam {
    @ApiModelProperty(value = "旅客id")
    Long id;
    @ApiModelProperty(value = "旅客姓名")
    String name;
    @ApiModelProperty(value = "用户id")
    Long userId;
    @ApiModelProperty(value = "旅客性别")
    String gender;
    @ApiModelProperty(value = "旅客生日")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    Date birthDate;
    @ApiModelProperty(value = "旅客手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    String phone;
    @ApiModelProperty(value = "旅客邮箱")
    @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",message = "邮箱格式不正确")
    String email;
    @ApiModelProperty(value = "旅客国籍")
    String nationality;
    @ApiModelProperty(value = "旅客身份证号码")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])\\d{3}[\\dXx]$",message = "身份证号码格式不正确")
    String cardNum;
}
